Skip to content

Clear nested candidates in select if certainty is yes #141927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 7, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jun 2, 2025

Proving these goals is redundant.

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 2, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

⌛ Trying commit 47dbfcd with merge c60b339

rust-bors bot added a commit that referenced this pull request Jun 2, 2025
[PERF] Clear nested candidates in select if certainty is yes

r? `@ghost`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 2, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 2, 2025

☀️ Try build successful (CI)
Build commit: c60b339 (c60b3390f6b226dae0b82633f7296f0b46664be9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c60b339): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.9%, -0.4%] 7
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.7% [0.4%, 3.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.2%, -0.5%] 7
All ❌✅ (primary) - - 0

Cycles

Results (secondary -0.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.4%, 0.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.0% [-1.8%, -0.6%] 9
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 743.192s -> 741.915s (-0.17%)
Artifact size: 372.27 MiB -> 372.25 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 3, 2025
@compiler-errors compiler-errors marked this pull request as ready for review June 3, 2025 17:26
@compiler-errors
Copy link
Member Author

Minor perf improvement...

r? lcnr

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2025

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@@ -159,6 +160,12 @@ fn to_selection<'tcx>(
})
.collect();

// Drop nested goals from selection since they can't constrain the impl args
// further if they're unambiguous.
if let Ok(Certainty::Yes) = cand.result() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not move this check higher up so that we don't even instantiate them if we've got Certainty::Yes. I can imagine that only instantiating the opt impl args would give us another 1-2%

@compiler-errors
Copy link
Member Author

@bors2 try parent=last @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

⌛ Trying commit 75b8312 with merge 36ffb8f

To cancel the try build, run the command @bors2 try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 3, 2025
rust-bors bot added a commit that referenced this pull request Jun 3, 2025
[PERF] Clear nested candidates in select if certainty is yes

Proving these goals is redundant.
@compiler-errors
Copy link
Member Author

@bors2 try cancel

@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

Try build cancelled. Cancelled workflows:

@compiler-errors
Copy link
Member Author

@bors2 try parent=last @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (95d796f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-19.7%, -0.3%] 9
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -10.9%, secondary -1.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.5%, 0.8%] 4
Improvements ✅
(primary)
-10.9% [-10.9%, -10.9%] 1
Improvements ✅
(secondary)
-1.6% [-4.8%, -0.4%] 12
All ❌✅ (primary) -10.9% [-10.9%, -10.9%] 1

Cycles

Results (secondary -1.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.4%, 1.7%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-18.3%, -0.5%] 9
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 743.192s -> 742.72s (-0.06%)
Artifact size: 372.27 MiB -> 372.22 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 4, 2025
@compiler-errors
Copy link
Member Author

seriously?? haha

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 4, 2025
bors added a commit that referenced this pull request Jun 4, 2025
[PERF] Clear nested candidates in select if certainty is yes

Proving these goals is redundant.
@bors
Copy link
Collaborator

bors commented Jun 4, 2025

⌛ Trying commit 1afd323 with merge 38419ce...

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

☀️ Try build successful - checks-actions
Build commit: 38419ce (38419ce1639bf75d983cee1d879c0425821cfb52)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (38419ce): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-19.8%, -0.4%] 10
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -1.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary -1.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [1.7%, 3.6%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-17.5% [-17.5%, -17.5%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 748.459s -> 749.441s (0.13%)
Artifact size: 371.85 MiB -> 371.84 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 4, 2025
let param_env = self.goal.goal.param_env;
let mut orig_values = self.goal.orig_values.to_vec();

let mut opt_impl_args = None;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vibeck:

change this to fn instantiate_impl_args and eagerly return (after instantiating the final state + dealing with the term hack) if there's a inspect::ProbeStep::RecordImplArgs and then unreachable!() after the for?

@lcnr
Copy link
Contributor

lcnr commented Jun 5, 2025

that is... something

r=me after nit

@compiler-errors
Copy link
Member Author

Not sure if this is exactly what u wanted, but I'd rather tweak this later since I want to land this.

@bors r=lcnr rollup=never

@bors
Copy link
Collaborator

bors commented Jun 5, 2025

📌 Commit 1e5cd12 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 5, 2025
@lcnr
Copy link
Contributor

lcnr commented Jun 6, 2025

this isn't quite what I want, but we can merge and change it later myself 😁

@compiler-errors compiler-errors changed the title [PERF] Clear nested candidates in select if certainty is yes Clear nested candidates in select if certainty is yes Jun 6, 2025
@bors
Copy link
Collaborator

bors commented Jun 7, 2025

⌛ Testing commit 1e5cd12 with merge 2f2c8c3...

@bors
Copy link
Collaborator

bors commented Jun 7, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 2f2c8c3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 7, 2025
@bors bors merged commit 2f2c8c3 into rust-lang:master Jun 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 7, 2025
Copy link
Contributor

github-actions bot commented Jun 7, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 5e0bdaa (parent) -> 2f2c8c3 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2f2c8c3512e82e4315db83bbb53eb79e2c566270 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 7169.0s -> 9327.4s (30.1%)
  2. mingw-check-2: 1856.0s -> 2133.1s (14.9%)
  3. x86_64-rust-for-linux: 2500.6s -> 2762.8s (10.5%)
  4. dist-arm-linux-musl: 5574.5s -> 5020.4s (-9.9%)
  5. aarch64-gnu-debug: 3516.1s -> 3800.2s (8.1%)
  6. dist-aarch64-apple: 4887.9s -> 5274.7s (7.9%)
  7. x86_64-gnu-llvm-19-2: 5502.4s -> 5885.6s (7.0%)
  8. i686-msvc-2: 7486.3s -> 6975.7s (-6.8%)
  9. dist-x86_64-netbsd: 4822.7s -> 4497.4s (-6.7%)
  10. dist-loongarch64-musl: 4757.8s -> 5071.2s (6.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2f2c8c3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-20.7%, -0.4%] 11
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 1.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.9% [4.9%, 4.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary -5.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.3% [-19.0%, -2.4%] 6
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 753.141s -> 752.958s (-0.02%)
Artifact size: 372.46 MiB -> 372.44 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants